<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>正面清单</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'/>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <%@include file="/WEB-INF/pages/common/common.jsp" %>
</head>
<body>
<div class="content content_frame">
    <h3 class="mainTitle"><img src="${basePath}/images/icon2.png"/>正面清单查询</h3>
    </br>
    <ul class="contentNav dib-wrap">
        <li class="dib" id="btnSearch" defaultkey='13'>
            <a><i class='fa fa-search'></i>&nbsp;&nbsp;查&nbsp;询 </a>
        </li>
        <li class="dib ">
            <a onclick="ClearAllInput('SearchTable')">
                <i class='fa fa-refresh'></i>&nbsp;&nbsp;重&nbsp;置 </a>
        </li>
    </ul>
    <br/>
    <table id="SearchTable" width="100%" class="table1">
        <tr>
            <td style="width: 50%;">
                <table width="100%" border="0" cellspacing="10" cellpadding="0">
                    <tr>
                        <td class="titleCss">
                            税则号列
                        </td>
                        <td class="tdCss">
                            <input type="text" placeholder="税则号列" datafield="SearchTable.taxNo">
                        </td>
                    </tr>
                </table>
            </td>
            <td style="width: 50%;">
                <table width="100%" border="0" cellspacing="10" cellpadding="0">
                    <tr>
                        <td class="titleCss">
                            中文货品名称
                        </td>
                        <td class="tdCss">
                            <input type="text" placeholder="中文货品名称" datafield="SearchTable.goodsName">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div class="cl"></div>
    <br/>
    <table id="corptable">
    </table>
    <div id="corptablePage">
    </div>
</div>
<script type="text/javascript">
       $(function () {
        $("#corptable").jqGrid({
            datatype: "json",
            url: "${basePath}/positiveList/queryTPositiveList",
            colNames: [
                '序号',
                '税则号列',
                '中文货品名称',
                '备注'
            ],
            colModel: [
                {name: 'idNo', index: 'idNo'},
                {name: 'taxNo', index: 'taxNo'},
                {name: 'goodsName', index: 'goodsName'},
                {name: 'note', index: 'note'}
            ],
            viewrecords: true,
            autowidth: true,
            height: 'auto',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            rownumbers: true,
            rownumWidth: 25,
            pager: "#corptablePage", //分页工具栏
            sortname: "idNo",
            sortorder: "",
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {
                    $(this).parent().children('.norecords').hide();
                }

                $("#corptable").setGridWidth($(window).width() * 0.98);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });
    });

    function reloadGrid() {
        var jsonStr = customFormToData("SearchTable");
        $("#corptable").jqGrid('setGridParam', {
            url: "${basePath}/positiveList/queryTPositiveList",
            postData: JSON.parse(jsonStr), //发送数据
            page: 1
        }).trigger("reloadGrid"); //重新载入
    }

    $(function () {
        $("#btnSearch").bind("click", function () {
            reloadGrid();
        });
    });
</script>
</body>
</html>
